<script>
	function createResponseCase()
	{
		loadId('configArea','project/responsecase');
	}

    function saveEndpointConfiguration()
    {
        var endpointLocation = $("#endpointLocation").val();
        var type = $("#requestType").val();
        var configArray = JSON.stringify(endpointConfigArray);

        post("project",{"method":"addEndpoint",
            "projectName":projectName,
            "endpoint":endpointLocation,
            "type":type,
            "jsonConfiguration":configArray}, null);        
    }

    function addEndpointConfiguration(jsonConfig) {
        endpointConfigArray.push(jsonConfig);
    }


    var endpointLocation = "";
    var endpointType = "";
    var endpointConfigArray = [];

    focus("endpointLocation");

</script>
<div id="projectGeneral" style="width:98%;">
	<div class="largeCategory">
		Add/Edit endpoint
	</div>
	<span class="longInputLabel">Endpoint location </span>
	<input class="long" id="endpointLocation" />
	<br />
	<span class="longInputLabel">Request type </span>
	<select class="long" id="requestType">
		<option value="1">GET/POST</option>
		<option value="2">GET</option>
		<option value="3">POST</option>
	</select>
	<br />
	<span class="longInputLabel" style="padding-top:20px;">&nbsp;</span>
	<span class="button" onclick="createResponseCase()">Add response case</span>
	<div id="configArea" style="margin-left:10px;margin-top:10px; width:98%"></div>
	<div class="largeCategory">
		Responses cases
	</div>
</div>

<div style="clear:both;" />

<span class="button" onclick="saveEndpointConfiguration()">Save endpoint configuration</span>
